package ac.github.os.internal.core.holder.damage

import org.bukkit.entity.LivingEntity
import org.bukkit.entity.Projectile
import org.bukkit.event.Event
import org.bukkit.event.entity.EntityDamageByEntityEvent

class DamageEntityHolder(
    event: EntityDamageByEntityEvent,
) : DamageHolder(event) {

    override fun variable(string: String): String? {
        return when (string) {
            "cause" -> event.cause.name
            "defender:name" -> event.entity.name
            "defender:type" -> event.entity.type.name
            "damager:name" -> entity.name
            "damage" -> event.damage.toString()
            "damager:type" -> event.damager.type.name
            "isProjectile" -> isProjectile.toString()
            "projectile:name" -> projectile.name
            else -> "null"
        }
    }

}